<template>
	<view class="myteacher">
		<view class="title">
			<u-icon name="arrow-left" size="24" @click="back"></u-icon>
			<text style="margin-left: 24rpx;">我的老师</text>
		</view>
		<view class="" style="height: 176rpx"></view>
		
		<view class="myteacherbox">
			<view class="boxitem" v-for="(item,index) in dataList">
				<view class="timeandstatus">
					<view class="time">
						申报时间:{{item.teacher.create_time}}
					</view>
					<view class="status">
						<view v-if="item.status == 0" class="statustext" style="color:#FE532D ;">
							待确认
						</view>
						<view v-if="item.status == 1" class="statustext" style="color:#4A9CFF ;">
							已确认
						</view>
						<view v-if="item.status == 2" class="statustext" style="color:#C90000  ;">
							已拒绝
						</view>
						<view v-if="item.status == 3" class="statustext" style="color:#999999 ;">
							已过期
						</view>
						<view v-if="item.status == 4" class="statustext" style="color:#999999 ;">
							已调换
						</view>
					</view>
				</view>

				<view class="imgandmessage">
					<view class="imgbox">
						<image class="handleimg" :src="item.teacher.photos.url"></image>
					</view>
					<view class="message">
						<view class="nameandmessage">
							<view class="name">
								{{item.teacher.name}}
							</view>
							<view class="jibie">
								{{item.teacher.category_text != null ? item.teacher.category_text :''}}
							</view>
						</view>
						<view class="desc">
							{{item.teacher.brief_introduction}}
						</view>
						<view class="zhuanye">
							<view class="zhuanyeitem" v-for="(subitem,ind) in item.teacher.science_ids_text">
								{{subitem}}
							</view>
						</view>

					</view>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	import {
		myteacherList
	} from "@/api/api.js"
	export default {
		data() {
			return {
				dataList: [
					// {
					// 	creatime: "2023/03/21 21:03",
					// 	name: "张宏建",
					// 	status: 0,
					// 	jibie: "硕士/博士导师",
					// 	zhuanye: ["电子商务", "环境工程", "国际贸易"],
					// 	desc: "山东农业大学马克思主义学院教授，硕士生导师，山东省高等教育学会..."
					// },
					// {
					// 	creatime: "2023/03/21 21:03",
					// 	name: "张宏建",
					// 	status: 1,
					// 	jibie: "硕士/博士导师",
					// 	zhuanye: ["电子商务", "环境工程", "国际贸易"],
					// 	desc: "山东农业大学马克思主义学院教授，硕士生导师，山东省高等教育学会..."
					// }
				]
			}
		},
		onLoad() {
			this.myteacherLists()
		},
		methods: {
			async myteacherLists() {
				let res = await myteacherList()
				if (res.code == 1) {
					console.log("我的老师", res)
					this.dataList = res.data
					this.dataList.forEach((item, index) => {
						item.teacher.science_ids_text = item.teacher.science_ids_text.split(",")
					})
				}
			},
			back() {
				uni.navigateBack({
					delta: 1
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	.myteacher {
		min-height: 100%;
		// background-color: pink;
		background: #F7F8FA;

		.title {
			width: 100%;
			height: 176rpx;
			padding-top: 110rpx;
			box-sizing: border-box;
			// background-color: red;
			display: flex;
			align-items: center;
			font-size: 32rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			color: #333333;
			line-height: 38rpx;
			padding-left: 34rpx;
			box-sizing: border-box;
			background-color: #ffffff;
			position: fixed;
			top: 0;
		}

		.myteacherbox {
			width: 100%;
			padding: 30rpx;
			box-sizing: border-box;
			margin-top: 30rpx;

			.boxitem {
				width: 690rpx;
				height: 360rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 0rpx 24rpx 0rpx rgba(206, 220, 237, 0.2);
				border-radius: 30rpx 30rpx 30rpx 30rpx;
				opacity: 1;
				margin-bottom: 30rpx;
				padding: 30rpx;
				box-sizing: border-box;

				.timeandstatus {
					display: flex;
					justify-content: space-between;
					font-size: 28rpx;
					font-family: PingFang SC-Bold, PingFang SC;
					font-weight: bold;
					color: #333333;
					line-height: 33rpx;
				}

				.imgandmessage {
					margin-top: 20rpx;
					display: flex;
					justify-content: space-between;

					.imgbox {
						.handleimg {
							width: 200rpx;
							height: 240rpx;
							border-radius: 20rpx;
						}
					}

					.message {
						width: 420rpx;
						height: 230rpx;
						margin-left: 20rpx;
						display: flex;
						flex-direction: column;
						justify-content: space-between;
						// padding: 30rpx 0;

						.nameandmessage {
							width: 100%;
							display: flex;
							justify-content: space-between;
							padding-right: 10rpx;
							box-sizing: border-box;
							align-items: center;
						}
						.name{
							width: 230rpx;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
						}

						.desc {
							font-size: 26rpx;
							font-family: PingFang SC-Regular, PingFang SC;
							font-weight: 400;
							color: #999999;
							line-height: 30rpx;
							overflow: hidden;
							-webkit-line-clamp: 2;
							text-overflow: ellipsis;
							display: -webkit-box;
							-webkit-box-orient: vertical;

						}

						.jibie {
							font-size: 26rpx;
							font-family: PingFang SC-Regular, PingFang SC;
							font-weight: 400;
							color: #666666;
							line-height: 30rpx;
						}

						.zhuanye {

							// display: flex;
							// justify-content: space-between;
							.zhuanyeitem {
								height: 34rpx;
								font-size: 24rpx;
								font-family: PingFang SC-Regular, PingFang SC;
								font-weight: 400;
								color: #4A9CFF;
								line-height: 28rpx;
								font-size: 24rpx;
								font-family: PingFang SC-Regular, PingFang SC;
								font-weight: 400;
								line-height: 28rpx;
								background: #F0F7FF;
								display: inline-block;
								margin-right: 10rpx;
								padding: 0 7rpx;
								padding-top: 5rpx;
								border-radius: 12rpx;
							}
						}
					}

				}
			}
		}
	}
</style>